* Replication file for Kropko and Banda

use "replication.dta", clear

/*
Codebook

selection: Chose candidate favored by proximity (0) or directional (1) theory
treatment: Exposed to policy (0) or intensity (1) treatment
side: candidates were both on the same side of the issue (0) or different sides (1)
healthinsure: Participants' self-placed positions on the health insurance issue,
	-4 "government insurance plan" to 4 "private insurance plan"
healthinsure_imp: How imporant participants think health insurance is an issue
	1  Not important at all
	2  Not too important
	3  Somewhat important
	4  Very important
	5  Extremely important
interest: Participants' levels of interest in politics
	1  Not interested at all
	2  Slightly interested
	3  Moderately interested
	4  Very interested
	5  Extremely interested
partyID: 7 point partisanship scale
	1  Strong Democrat
	2  Not very strong Democrat
	3  Independent, Leans Democrat
	4  Independent
	5  Independent, Leans Republican
	6  Not very strong Republican
	7  Strong Republican
pid3: 3 point partisanship scale, leaners treated as partisans
	1  Democrat
	2  Independent
	3  Republican
theorycandidate: Participant chose the atheoretical choice (0) or theoretical choice (1)
undecided: the word "undecided" did not (0) or did (1) appear in the text of the treatment.
zero: Participant did not (0) or did (1) place themselves at 0 on the health insurance issue scale
educ2: Participant's levels of education
	0  Less than high school
	1  High school
	2  Some college, no degree
	3  Associate's degree
	4  Bachelor's degree
	5  Post graduate degree
*/




* Figure 2
histogram healthinsure, discrete frequency addlabel xsize(4) ysize(4) ///
	addlabopts(mlabsize(medium) mlabcolor(black)) xlabel(-4(1)4, labsize(medium)) ///
	xtitle(" " "Self-placement on health insurance", size(medium)) ///
	ytitle("Frequency" " ", size(medium)) ylabel(, labsize(medium)) bcolor(gs4) xscale(range(-5 5))

* Table 3 and Figure 4
* Without 0's
logit selection i.treatment if healthinsure!=0
estat ic
margins, at(treatment=(0 1))
marginsplot, x(treatment) recast(bar) ciopts(lc("black") msize(*1.5) lw(.7)) ///
	level(95) title("") xtitle(" " "Treatment", size(medium)) ///
	xlabel(0 "Policy" 1 "Intensity", labsize(medium)) ylabel(0(.1)1, labsize(medium)) ///
	ytitle("Predicted probability of selecting" "the directional candidate" " ", size(medium)) ///
	ysize(4) xsize(4) plotopt(barwidth(.9) col(gs4)) yline(0 1, lc(white) lp(solid))

* With 0's
logit selection i.treatment
estat ic
margins, at(treatment=(0 1))
marginsplot, x(treatment) recast(bar) ciopts(lc("black") msize(*1.5) lw(.7)) ///
	level(95) title("") xtitle(" " "Treatment", size(medium)) ///
	xlabel(0 "Policy" 1 "Intensity", labsize(medium)) ylabel(0(.1)1, labsize(medium)) ///
	ytitle("Predicted probability of selecting" "the directional candidate" " ", size(medium)) ///
	ysize(4) xsize(4) plotopt(barwidth(.9) col(gs4)) yline(0 1, lc(white) lp(solid))
	
* Table 4 and Figure 5
* Conditioned by interest?
logit selection c.treatment##c.interest
estat ic
margins, dydx(treatment) at(interest=(1(1)5)) 
marginsplot, yline(0, lc(red)) yline(-.4 .4, lc(white) lp(solid)) ///
	xsize(4) ysize(4) plot1opts(mc("black") msize(3) lw(1)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	title("") xtitle(" " "Level of interest in politics", size(medium)) ///
	xlabel(1 "Lowest" 2 " " 3 " " 4 " " 5 "Highest", labsize(medium)) ///
	ytitle("Marginal effect" " ", size(medium)) ylabel(, labsize(medium))
margins, at(treatment=(0 1) interest=(1 2 3 4 5)) 
marginsplot, recast(bar) xdim(interest treatment) plotdim(treatment) ///
	ylabel(0(.1)1, labsize(medium)) ysize(4) xsize(4) yline(0 1, lc(white) lp(solid)) ///
	plot1opt(barwidth(.9) col(gs4) lc(black)) plot2opt(barwidth(.9) col(white) lc(black)) ///
	ci2opt(col(black)) xtitle(" " "Level of interest in politics", size(medium)) title("") ///
	ytitle("Predicted probability of selecting" "the directional candidate" " ", size(medium)) ///
	xlabel(1.5 "1" 3.5 "2" 5.5 "3" 7.5 "4" 9.5 "5", labsize(medium)) legend(pos(6) col(2))

* Conditioned by importance?
logit selection c.treatment##c.healthinsure_imp
estat ic
margins, dydx(treatment) at(healthinsure_imp=(1(1)5)) 
marginsplot, yline(0, lc(red)) yline(-.4 .4, lc(white) lp(solid)) ///
	xsize(4) ysize(4) plot1opts(mc("black") msize(3) lw(1)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	title("") xtitle(" " "Perceived importance of health insurance", size(medium)) ///
	xlabel(1 "Lowest" 2 " " 3 " " 4 " " 5 "Highest", labsize(medium)) ///
	ytitle("Marginal effect" " ", size(medium)) ylabel(, labsize(medium))
margins, at(treatment=(0 1) healthinsure_imp=(1 2 3 4 5)) 
marginsplot, recast(bar) xdim(healthinsure_imp treatment) plotdim(treatment) ///
	ylabel(0(.1)1, labsize(medium)) ysize(4) xsize(4) yline(0 1, lc(white) lp(solid)) ///
	plot1opt(barwidth(.9) col(gs4) lc(black)) plot2opt(barwidth(.9) col(white) lc(black)) ///
	ci2opt(col(black)) xtitle(" " "Perceived importance of health insurance", size(medium)) title("") ///
	ytitle("Predicted probability of selecting" "the directional candidate" " ", size(medium)) ///
	xlabel(1.5 "1" 3.5 "2" 5.5 "3" 7.5 "4" 9.5 "5", labsize(medium)) legend(pos(6) col(2))

* Models mentioned in Footnote 9
logit selection c.treatment##c.interest if healthinsure!=0
estat ic
margins, dydx(treatment) at(interest=(1(1)5))
marginsplot, yline(0, lc(red)) yline(-.4 .4, lc(white) lp(solid)) ///
	xsize(4) ysize(4) plot1opts(mc("black") msize(3) lw(1)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	title("") xtitle(" " "Level of interest in politics", size(medium)) ///
	xlabel(1 "Lowest" 2 " " 3 " " 4 " " 5 "Highest", labsize(medium)) ///
	ytitle("Marginal effect" " ", size(medium)) ylabel(, labsize(medium))

logit selection c.treatment##c.healthinsure_imp if healthinsure!=0
estat ic
margins, dydx(treatment) at(healthinsure_imp=(1(1)5)) 
marginsplot, yline(0, lc(red)) yline(-.4 .4, lc(white) lp(solid)) ///
	xsize(4) ysize(4) plot1opts(mc("black") msize(3) lw(1)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	title("") xtitle(" " "Perceived importance of health insurance", size(medium)) ///
	xlabel(1 "Lowest" 2 " " 3 " " 4 " " 5 "Highest", labsize(medium)) ///
	ytitle("Marginal effect" " ", size(medium)) ylabel(, labsize(medium))

* Table 5 and Figure 6
* Theoretical vs atheoretical choice
logit theorycandidate i.treatment
margins, at(treatment=(0 1))
marginsplot, x(treatment) recast(bar) ciopts(lc("black") msize(*1.5) lw(.7)) ///
	level(95) title("") xtitle(" " "Treatment", size(medium)) ///
	xlabel(0 "Policy" 1 "Intensity", labsize(medium)) ylabel(0(.1)1, labsize(medium)) ///
	ytitle("Predicted probability of selecting" "the theoretical candidate" " ", size(medium)) ///
	ysize(4) xsize(4) plotopt(barwidth(.9) col(gs4)) yline(0 1, lc(white) lp(solid))







* Appendix B

* Does whether the candidates are on the same or different sides condition the treatment?
logit selection c.treatment##c.side if healthinsure==-1 | healthinsure==0 | healthinsure==1
estat ic
margins, dydx(treatment) at(side=(0 1)) 
marginsplot, recast(scatter) yline(0, lc(red)) xsize(4) ysize(4) plot1opts(mc("black") msize(3)) ///
	ciopts(col(black) ls(2) lw(1)) xscale(range(-0.5 1.5)) ///
	xlabel(0 "Same side" 1 "Different sides", labsize(medium)) ///
	title("") xtitle(" " "Candidates are located on the same" "or different sides of the issue", size(medium)) ///
	ytitle("Marginal effect" " ", size(medium)) ylabel(, labsize(medium))

* "Undecideds" (candidates placed at -1 or 1)
logit selection c.treatment##c.undecided
estat ic
margins, dydx(treatment) at(undecided=(0 1)) 
marginsplot, recast(scatter) yline(0, lc(red)) xsize(4) ysize(4) plot1opts(mc("black") msize(3)) ///
	ciopts(col(black) ls(2) lw(1)) xscale(range(-0.5 1.5)) ///
	xlabel(0 "No" 1 "Yes", labsize(medium)) ///
	title("") xtitle(" " `"The word "undecided" appears"' "in the intensity treatment", size(medium)) ///
	ytitle("Marginal effect" " ", size(medium)) ylabel(, labsize(medium))




* Appendix C

* Self-placement
logit selection c.treatment##c.healthinsure
estat ic
margins, dydx(treatment) at(healthinsure=(-3 (1) 3)) 
marginsplot, yline(0, lc(red)) xsize(4) ysize(4) plot1opts(mc("black") msize(3) lw(1)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	title("") xtitle(" " "Health insurance conservatism") ///
	xlabel(-3 "-3" -2 "-2" -1 "-1" 0 "0" 1 "1" 2 "2" 3 "3") ///
	ytitle("Marginal effect" " ")

* Self-placements at zero
logit selection c.treatment##c.zero
estat ic
margins, dydx(treatment) at(zero=(0 1)) 
marginsplot, recast(scatter) yline(0, lc(red)) xsize(4) ysize(4) plot1opts(mc("black") msize(3)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	xlabel(-.5 " " 0 "Non-zero" .5 " " 1 "Zero" 1.5 " ", noticks) ///
	title("") xtitle(" " "Health insurance self placement") ///
	ytitle("Marginal effect" " ")

* Education
logit selection c.treatment##c.educ2
estat ic
margins, dydx(treatment) at(educ2=(0 (1) 6)) 
marginsplot, yline(0, lc(red)) xsize(4) ysize(4) plot1opts(mc("black") msize(3) lw(1)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	title("") xtitle(" " "Level of education") ///
	ytitle("Marginal effect" " ") yline(.3, lc(white) lp(solid))

* Party ID
logit selection c.treatment##i.pid3
estat ic
margins, dydx(treatment) at(pid3=(1 2 3)) 
marginsplot, recast(scatter) yline(0, lc(red)) xsize(4) ysize(4) plot1opts(mc("black") msize(3)) ///
	ciopts(col(black) ls(2) lw(1)) ///
	xlabel(1 "Democrats" 2 "Independents" 3 "Republicans", noticks) ///
	title("") xtitle(" " "Partisanship") ///
	ytitle("Marginal effect" " ") xscale(range(0.8 3.2)) yline(.3, lc(white) lp(solid))
